package StreamOf;

import java.util.regex.Pattern;
import java.util.stream.Stream;

/**
 * @author zc
 * @version 1.0
 * @date 2021/9/24 11:57
 * 使用 Pattern.splitAsStream() 方法，将字符串分隔成流
 */
public class Test6 {
    public static void main(String[] args) {
        //使用 Pattern.splitAsStream() 方法，将字符串分隔成流
        Pattern pattern = Pattern.compile(",");
        Stream<String> stringStream = pattern.splitAsStream("aa,b,c,d,e");
        stringStream.forEach(System.out::println);

    }
}
